#include <_semaphore.h>
#define _LOCKCOND_H_INCLUDE_

typedef struct lock {
	int mutex;
	int next;
	int nextCount;
} lock;

typedef struct cond {
	lock* l;
	int condSem;
	int semCount;
} cond;

void lock_init(struct lock* l);
void lock_acquire(struct lock* l);
void cond_init(struct cond *cnd, struct lock *l);
void cond_wait(struct cond *cnd);
void cond_signal (struct cond *cnd);

